<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
        <title></title>
    </head>
    <script src="https://ssl.captcha.qq.com/TCaptcha.js"></script>
    <body>
    </body>
    <script type="text/javascript">
        (function(){
            // 验证成功返回ticket
            window.SDKTCaptchaVerifyCallback = function (retJson) {
                if (retJson){ window.webkit.messageHandlers.verifiedAction.postMessage(retJson) }
            };

            // 验证码加载完成的回调，用来设置webview尺寸
            window.SDKTCaptchaReadyCallback = function (retJson) {
                if (retJson && retJson.sdkView && retJson.sdkView.width && retJson.sdkView.height && parseInt(retJson.sdkView.width) >0 && parseInt(retJson.sdkView.height) >0 ){
                    window.webkit.messageHandlers.loadAction.postMessage(retJson)
                }
            };
            
            window.onerror = function (msg, url, line, col, error) {
                if (window.TencentCaptcha == null) {
                    window.webkit.messageHandlers.errorAction.postMessage(error)
                }
            };
            
            var sdkOptions = {};
            sdkOptions.ready = window.SDKTCaptchaReadyCallback;
            sdkOptions.needFeedBack = false;
            
            window.onload = function () {
                new TencentCaptcha('1234', SDKTCaptchaVerifyCallback, sdkOptions).show();
            };
        })();
    </script>
</html>
